@extends('admin.layout.layout')
@section('content')
    <div class="mws-panel grid_8">
        <div class="mws-panel-header">
            <span>添加分类</span>
        </div>
        <div class="mws-panel-body no-padding">
            <form action="/admin/cate/updata/{{$dataOne['cate_id']}}" method="post" class="mws-form">
                {{ csrf_field()}}
                <fieldset class="mws-form-inline">

                    <div class="mws-form-row bordered">
                        <label class="mws-form-label">分类:</label>
                        <div class="mws-form-item">
                            <input type="text" class="small" name="cate_name" value="{{$dataOne['cate_name']}}">
                        </div>
                    </div>

                </fieldset>
                <fieldset class="mws-form-inline">
                    <div class="mws-form-row bordered">
                        <label class="mws-form-label">父级:</label>
                        <div class="mws-form-item">
                            <select class="small" name="cate_pid">
                                <option value="0">--请选择--</option>
                                @foreach($data as $k=>$v)
                                    //跳过他的子分类和当前分类
                                    @if( $v['cate_id']==$dataOne['cate_id'] ||in_array($v['cate_id'],$CateChileData))
                                      continue;
                                    @else
                                    <option  value="{{$v['cate_id']}}"
                                    @if( $dataOne['cate_pid']==$v['cate_id']) selected @endif
                                    >{{str_repeat('|--',$v['cengji']) }}{{$v['cate_name']}}</option>
                                    @endif
                                @endforeach
                            </select>
                        </div>
                    </div>
                </fieldset>
                <div class="mws-button-row">
                    <input type="submit" class="btn btn-danger" value="提交">
                    <input type="reset" class="btn " value="重置">
                </div>
            </form>
        </div>
    </div>
    @endsection
